import http from '@/utils/request.js';
export const getConfig = (data) => {
	return http.request({
		url: '/tenant/config',
		method: 'get',
		data,
		toast: false,
		timeout: false,
	}).then(response => {
		// 在这里处理返回的数据
		// 例如：对数据进行转换、过滤或其他操作
		// console.log('http.request', response);
		uni.setStorage({
			key: 'offline_config',
			data: response.data.config || {}
		});
		return response;
	});
};
// 预计完成时间
export const timeUpdate = (data) => {
	// return http.post('/repair/maintain/plan/content/detail/update', data, true);
	return http.request({
		url: '/repair/maintain/plan/content/detail/update',
		method: 'post',
		data,
		textJson: true,
	});
};
// 获取工单是否未签退(旧)
export const checkAllowSign = (data) => {
	// return http.get('/repair/maintain/plan/content/allow/sign', data);
	return http.request({
		url: '/repair/maintain/plan/content/allow/sign',
		method: 'get',
		data,
	});
};

// 判断工单是否有签退(新,弹窗添加内容)
export const checkCanSignOut = (data) => {
	// return http.get('/check/plans/isSignOut', data);
	return http.request({
		url: '/check/plans/isSignOut',
		method: 'get',
		data,
	});
};

// 获取全年节假日
export const getHolidays = (data) => {
	// return http.get('/repair/user/sign/getHolidays', data);
	return http.request({
		url: '/repair/user/sign/getHolidays',
		method: 'get',
		data,
	});
};